Tutorial - Dynamics Canalization Map (DCM)


In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline

In [5]:
import os
from cana.datasets.bio import THALIANA, DROSOPHILA, BUDDING_YEAST
import cana
from cana.drawing.canalizing_map import draw_canalizing_map_graphviz
from IPython.display import display
import subprocess

In [10]:
N = THALIANA()
#N = DROSOPHILA()
#N = BUDDING_YEAST()
print(N)


<BNetwork(Name='Arabidopsis Thaliana', N=15, Nodes=['AP3', 'UFO', 'FUL', 'FT', 'AP1', 'EMF1', 'LFY', 'AP2', 'WUS', 'AG', 'LUG', 'CLF', 'TFL1', 'PI', 'SEP'])>

In [11]:
if N.name == 'Arabidopsis Thaliana':
    foldername = 'thaliana'
elif N.name == 'Drosophila Melanogaster':
    foldername = 'drosophila'
elif N.name == 'Budding Yeast Cell Cycle':
    foldername = 'yeast'

In [19]:
# Request the DCM to the Network
DCM = N.dynamics_canalization_map(output=None)
# Draws using the graphviz interface.
D = draw_canalizing_map_graphviz(DCM)

## Display
display(D)

## Save to file
D._format = 'svg'
efile = u'%s/../experiments/2017 - BioModels/%s/DCM/DCM' % (os.getcwd(), foldername)
#D.render(efile, cleanup=True)
#subprocess.call("inkscape -z -d 150 '%s.svg' -e '%s.png'" % (efile,efile) , shell=True)


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-19-2651d9b01d16> in <module>()
      2 DCM = N.dynamics_canalization_map(output=None)
      3 # Draws using the graphviz interface.
----> 4 D = draw_canalizing_map_graphviz(DCM)
      5 
      6 ## Display

~/Documents/GitHub/CANA/cana/drawing/canalizing_map.py in draw_canalizing_map_graphviz(DG, on_node_fillcolor, on_node_fontcolor, off_node_fillcolor, off_node_fontcolor, input_node_bordercolor, output_node_bordercolor, controlled_node_bordercolor, constant_node_bordercolor, literal_edge_color, output_edge_color, fusing_edge_color, fused_edge_color, fusing_edge_arrowhead, fused_edge_arrowhead, literal_edge_arrowhead, out_edge_arrowhead, *args, **kwargs)
    111 
    112                         else:
--> 113                                 raise AttributeError("Node type could not be found. Must be either 'out', 'literal', 'fusing' or 'fused'.  Got %s." % str(d['type']))
    114                 G.edge(s, t, arrowhead=arrowhead, color=color)
    115 

AttributeError: Node type could not be found. Must be either 'out', 'literal', 'fusing' or 'fused'.  Got simplified.

In [ ]: